<?php
	$ROOT = "../media/material/";
	$ROOTOFINDEX = "media/material/";
	
	if(!is_dir($ROOT)){
		echo "error : root not exits";
	}
	else{
		$dh = opendir($ROOT);
		$json = "{
					";
		while (($file = readdir($dh)) !== false) {
			if($file[0] === '.') {
				continue;
			}
			if(strtolower(substr($file, -5, 5)) == '.json'){
				$fxName = substr($file, 0, -5);
				$json .= "'$fxName' : '{$ROOTOFINDEX}{$file}', ";	
			}
		}
		$json .= "}";
	}
	echo $json;
?>